Functions and Statements

ProModel uses several functions and statements specifically for shift and break logic: SKIP, PRIORITY, DTLEFT(), FORLOCATION(), and FORRESOURCE(). Following is a brief description of each. For more details, see Statements and Functions.

SKIP If used in pre-logic, it causes the off-shift or break time (including any off-shift or break logic) to be skipped so a location or resource never goes off line. If used in the off-shift or break logic, it causes the off-line time defined in the Calendar Editor to be skipped. This allows you to specify a WAIT statement for the off-line time and skip the off-line time defined in the Calendar Editor.

PRIORITY This statement provides an alternative way to specify off-shift or break priorities. It also allows the priority to be changed after some time being off-shift or on break. If the priority is changed to a value lower than the current value, the system will check to see if any preemption may occur at that time. This statement is not allowed in off-shift or break pre-start logic.

DTLEFT() This function returns the remaining off-shift time based on when the location or resource is scheduled to go back on shift as defined in the shift file. It may be used in off-shift and break logic to adjust the actual time the location or resource is off-line.

FORLOCATION() This function returns TRUE if the member for which the shift or break logic being executed is a location. This may be followed by a test using the LOCATION() function to determine the precise location.

FORRESOURCE() This function returns TRUE if the member for which the shift or break logic being executed is a resource. The RESOURCE() function may then be used to determine the precise resource if multiple resources are listed as members.

RESOURCE() This returns the name-index number of the resource currently processing the off-shift or break logic.

To illustrate how FORLOCATION() and FORRESOURCE() might be used, consider the following example: Suppose you have locations and resources as members in a shift file assignment and you want to wait until variable Applications is equal to zero before allowing a particular resource called Loan_Officer to go off shift. You would enter the following pre-off shift logic:

Pre-off shift logic

IF FORRESOURCE() THEN

BEGIN

IF RESOURCE() = Loan_Officer THEN

BEGIN

WAIT UNTIL Applications = 0

END

END

In addition to these functions, DTDELAY() may also be called at the beginning of the off-shift or break logic to determine how much time has elapsed between the time the shift downtime was scheduled to start and when it actually started. The length of the shift downtime defined in the shift file would be the sum of DTDELAY() and DTLEFT().